package com.ll.aync;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;

@Configuration
@ComponentScan("com.ll.aync")
@EnableAsync // 开启异步
public class EventListenerConfig {
    @Bean
    public TaskExecutor executor() {
        return new SimpleAsyncTaskExecutor("EventListen-");
    }
}